package abstractEntities;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.GenericGenerator;

import entities.User;

/**
 * AbstractUserranking entity provides the base persistence definition of the
 * Userranking entity. @author MyEclipse Persistence Tools
 */
@MappedSuperclass
public abstract class AbstractUserranking implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -6729607673569418972L;
	private Integer idRankingU;
	private User userByIdUser2;
	private User userByIdUser3;
	private User userByIdUser4;
	private User userByIdUser5;
	private User userByIdUser1;
	private Date date;

	// Constructors

	/** default constructor */
	public AbstractUserranking() {
	}

	/** minimal constructor */
	public AbstractUserranking(Date date) {
		this.date = date;
	}

	/** full constructor */
	public AbstractUserranking(User userByIdUser2, User userByIdUser3,
			User userByIdUser4, User userByIdUser5, User userByIdUser1,
			Date date) {
		this.userByIdUser2 = userByIdUser2;
		this.userByIdUser3 = userByIdUser3;
		this.userByIdUser4 = userByIdUser4;
		this.userByIdUser5 = userByIdUser5;
		this.userByIdUser1 = userByIdUser1;
		this.date = date;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "idRankingU", unique = true, nullable = false)
	public Integer getIdRankingU() {
		return this.idRankingU;
	}

	public void setIdRankingU(Integer idRankingU) {
		this.idRankingU = idRankingU;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idUser2")
	public User getUserByIdUser2() {
		return this.userByIdUser2;
	}

	public void setUserByIdUser2(User userByIdUser2) {
		this.userByIdUser2 = userByIdUser2;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idUser3")
	public User getUserByIdUser3() {
		return this.userByIdUser3;
	}

	public void setUserByIdUser3(User userByIdUser3) {
		this.userByIdUser3 = userByIdUser3;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idUser4")
	public User getUserByIdUser4() {
		return this.userByIdUser4;
	}

	public void setUserByIdUser4(User userByIdUser4) {
		this.userByIdUser4 = userByIdUser4;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idUser5")
	public User getUserByIdUser5() {
		return this.userByIdUser5;
	}

	public void setUserByIdUser5(User userByIdUser5) {
		this.userByIdUser5 = userByIdUser5;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idUser1")
	public User getUserByIdUser1() {
		return this.userByIdUser1;
	}

	public void setUserByIdUser1(User userByIdUser1) {
		this.userByIdUser1 = userByIdUser1;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "date", nullable = false, length = 10)
	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

}